﻿
namespace SPContrib.Extensions
{
    /// <summary>
    /// Extensions for the Expression class
    /// </summary>
    public static class ExpressionExtensions
    {
        //public static T Execute<T>(this Expression<Func<T>> instance) 
        //{ 
        //    return instance.Compile()(); 
        //}

        //public static T Execute<T>(this Expression instance) 
        //{ 
        //    return Execute<T>(Expression.Lambda<Func<T>>(instance)); 
        //}

        //public static void Execute(this Expression<Action> instance) 
        //{ 
        //    instance.Compile()(); 
        //}

        //public static Expression Cast<T>(this Expression instance)
        //{
        //    if (instance.Type == typeof(T))
        //    {
        //        return instance;
        //    }
        //    return Expression.TypeAs(instance, typeof(T));
        //}
    }
}
